
package com.myway.dto.ics;



/**
 *
 *
 * @author vunloon
 * @since May 17, 2008
 **/
public class DTOSubCabin implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1843495339056439092L;
	
	private long subcabinId;
	private DTOMainCabin mainCabin;
	
	private String subCabin;
	private Integer totalCount=0;
	private Integer reservedCount=0;
	private Integer soldCount=0;
	private String state;
	
	private Integer sequence;
	
	/**
	 * 库存数
	 * ~~------------------------------------------------------
	 * 对于可以“借位”的航班库存计算按照销售优先级嵌套计算
	 * 
	 * 对于多航段航班 以HAK-CAN-HAK为例
	 * 
	 *  >>>>>>>>> 销售优先级 A>B>C>D
	 * 
	 * HAK-CAN
	 * 
	 * 	舱位   可卖数   预定数  出票数  原始库存  销售库存
	 *  A 		   10        2          10        -2           37
	 *  B        12        3           3         6            37
	 *  C       25        3            2        20           31
	 *  D       16        2           1         13           11
	 *  
	 * CAN-PEK 
	 * 
	 * 	舱位   可卖数   预定数  出票数  原始库存  销售库存
	 *  A 		20     2      10      8       20
	 *  B       12     3      18     -9       12
	 *  C       25     3      6      16       12
	 *  D        8     2      1       5        0
	 *  
	 *  
	 *  HAK-CAN
	 *  
	 *  舱位   销售库存
	 *  A      20
	 *  B      12
	 *  C      12
	 *  D       0
	 *  
	 *  
	 *  
	 * >>>>>>>>>
	 * 
	 * 
	 * 
	 * 
	 * 对于非“借位”航班，库存直接使用可卖数-已卖数
	 * ~~------------------------------------------------------
	 */
	private long inventory;
	
	
	
	
	/**
	 * @return the subcabinId
	 */
	public long getSubcabinId() {
		return this.subcabinId;
	}
	/**
	 * @param subcabinId the subcabinId to set
	 */
	public void setSubcabinId(long subcabinId) {
		this.subcabinId = subcabinId;
	}
	/**
	 * @return the mainCabin
	 */
	public DTOMainCabin getMainCabin() {
		return this.mainCabin;
	}
	/**
	 * @param mainCabin the mainCabin to set
	 */
	public void setMainCabin(DTOMainCabin mainCabin) {
		this.mainCabin = mainCabin;
	}
	/**
	 * @return the subCabin
	 */
	public String getSubCabin() {
		return this.subCabin;
	}
	/**
	 * @param subCabin the subCabin to set
	 */
	public void setSubCabin(String subCabin) {
		this.subCabin = subCabin;
	}
	/**
	 * @return the totalCount
	 */
	public Integer getTotalCount() {
		return this.totalCount;
	}
	/**
	 * @param totalCount the totalCount to set
	 */
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	/**
	 * @return the reservedCount
	 */
	public Integer getReservedCount() {
		return this.reservedCount;
	}
	/**
	 * @param reservedCount the reservedCount to set
	 */
	public void setReservedCount(Integer reservedCount) {
		this.reservedCount = reservedCount;
	}
	/**
	 * @return the soldCount
	 */
	public Integer getSoldCount() {
		return this.soldCount;
	}
	/**
	 * @param soldCount the soldCount to set
	 */
	public void setSoldCount(Integer soldCount) {
		this.soldCount = soldCount;
	}
	/**
	 * @return the state
	 */
	public String getState() {
		return this.state;
	}
	/**
	 * @param state the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}
	/**
	 * @return the inventory
	 */
	public long getInventory() {
		return this.inventory;
	}
	/**
	 * @param inventory the inventory to set
	 */
	public void setInventory(long inventory) {
		this.inventory = inventory;
	}
	
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("[").append(getSubcabinId()).append("] ")
			.append(getSubCabin())
			.append(" ")
			.append(getState())
			.append(" Total: ")
			.append(getTotalCount())
			.append(" Sold: ")
			.append(getSoldCount())
			.append(" Reserved: ")
			.append(getReservedCount());
		return buf.toString();
	}
	
	/**
	 * @return the sequence
	 */
	public Integer getSequence()
	{
		return sequence;
	}
	
	/**
	 * @param sequence the sequence to set
	 */
	public void setSequence(Integer sequence)
	{
		this.sequence = sequence;
	}

	
}
